package com.ruoyi.prt.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.prt.domain.PrtRechargeLog;
import com.ruoyi.prt.domain.vo.PrtRechargeLogVO;
import com.ruoyi.prt.mapper.PrtRechargeLogMapper;
import com.ruoyi.prt.service.IPrtRechargeLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 充值记录Service业务层处理
 *
 * @author xiaobo Yan
 * @date 2021-03-31
 */
@Service
public class PrtRechargeLogServiceImpl implements IPrtRechargeLogService
{
    @Autowired
    private PrtRechargeLogMapper prtRechargeLogMapper;

    /**
     * 查询充值记录
     *
     * @param rechargeLogId 充值记录ID
     * @return 充值记录
     */
    @Override
    public PrtRechargeLog selectPrtRechargeLogById(String rechargeLogId)
    {
        return prtRechargeLogMapper.selectPrtRechargeLogById(rechargeLogId);
    }

    /**
     * 查询充值记录列表
     *
     * @param prtRechargeLog 充值记录
     * @return 充值记录
     */
    @Override
    public List<PrtRechargeLog> selectPrtRechargeLogList(PrtRechargeLog prtRechargeLog)
    {
        return prtRechargeLogMapper.selectPrtRechargeLogList(prtRechargeLog);
    }

    @Override
    public PageInfo <PrtRechargeLog> selectPrtRechargeLogList(PrtRechargeLogVO prtRechargeLog) {
        PageHelper.startPage(prtRechargeLog.getPageIndex(), prtRechargeLog.getPageSize());
        List<PrtRechargeLog> list = prtRechargeLogMapper.selectPrtRechargeLogByTime(prtRechargeLog);
        return new PageInfo <>(list);
    }

    /**
     * 新增充值记录
     *
     * @param prtRechargeLog 充值记录
     * @return 结果
     */
    @Override
    public int insertPrtRechargeLog(PrtRechargeLog prtRechargeLog)
    {
        return prtRechargeLogMapper.insertPrtRechargeLog(prtRechargeLog);
    }

    /**
     * 新增充值记录
     *
     * @param rechargeLogId 充值记录
     * @return 结果
     */
    @Override
    public int updatePrtRechargeLogById(String rechargeLogId)
    {
        return prtRechargeLogMapper.updatePrtRechargeLogById(rechargeLogId);
    }

    /**
     * 修改充值记录
     *
     * @param prtRechargeLog 充值记录
     * @return 结果
     */
    @Override
    public int updatePrtRechargeLog(PrtRechargeLog prtRechargeLog)
    {
        return prtRechargeLogMapper.updatePrtRechargeLog(prtRechargeLog);
    }

    /**
     * 批量删除充值记录
     *
     * @param rechargeLogIds 需要删除的充值记录ID
     * @return 结果
     */
    @Override
    public int deletePrtRechargeLogByIds(String[] rechargeLogIds)
    {
        return prtRechargeLogMapper.deletePrtRechargeLogByIds(rechargeLogIds);
    }

    /**
     * 删除充值记录信息
     *
     * @param rechargeLogId 充值记录ID
     * @return 结果
     */
    @Override
    public int deletePrtRechargeLogById(String rechargeLogId)
    {
        return prtRechargeLogMapper.deletePrtRechargeLogById(rechargeLogId);
    }
}
